<?php

namespace App\Http\Requests\Auth;

use App\Http\Requests\BaseRequest;

class RegisterRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required|unique:users|max:16',
            'email' => 'required|email:rfc,dns|unique:users',
            'password' =>'required|min:6|max:15|confirmed',
        ];
    }
    public function messages()
    {
        return [
            'name.required' => '用户名不能为空',
            'name.unique' => '用户名已经存在',
            'email.required' => '邮箱不能为空',
        ];
    }
}
